package com.example.modulethree.adapter.delegate

import android.text.TextUtils
import android.widget.TextView
import com.example.modulethree.R
import com.example.mvp.delegate.BaseAdapterDelegate

/**
 * 测试适配器视图改变控制类
 * Created by sun.li on 2018/6/28.
 *
 * @author sun.li
 */

class KotlinTestAdapterDelegate : BaseAdapterDelegate() {

    override fun initLayoutRes(): Int {
        return R.layout.adapter_kotlin_test_item
    }

    override fun getOptionsMenuId(): Int {
        return 0
    }

    override fun initWidget() {
        setText("item_test")
    }

    fun setText(str: String) {
        if (!TextUtils.isEmpty(str)) {
            val textView1 = getView<TextView>(R.id.tv_ati_text)
            textView1.text = str
        }
    }


    override fun onDestroy() {

    }
}